package com.xxmw.transaction.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 自定义注解 验证值是否大于value
 * 参考规范 {@link org.hibernate.validator.constraints.Length}
 * @since  2020/2/28 14:59
 * @author luowenliang
 */
@Documented
@Constraint(validatedBy = {DecimalGtValidatorForString.class})
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
@Repeatable(DecimalGt.List.class)
public @interface DecimalGt {

	String value() default "0";

	String message() default "{com.xxmw.transaction.valid.DecimalGt.message}";

	Class<?>[] groups() default { };

	Class<? extends Payload>[] payload() default { };

	@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
	@Retention(RUNTIME)
	@Documented
	public @interface List {
		DecimalGt[] value();
	}

}
